-
Notifications
You must be signed in to change notification settings - Fork 619
Show 404 on invalid contract address in contract page #5140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show 404 on invalid contract address in contract page #5140
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @MananTank and the rest of your teammates on |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5140 +/- ##
=======================================
Coverage 45.43% 45.43%
=======================================
Files 1066 1066
Lines 55150 55150
Branches 3974 3974
=======================================
Hits 25055 25055
Misses 29403 29403
Partials 692 692
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
| if (!isAddress(props.params.contractAddress)) { | ||
| return notFound(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again this should be a special error case down the line
Merge activity
|
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR enhances the `Layout` component by adding a validation check to ensure that the `contractAddress` parameter is a valid address using `isAddress`. If the address is invalid, it returns a "not found" response.
### Detailed summary
- Imported `isAddress` from `thirdweb/utils`.
- Added a check to validate `props.params.contractAddress` using `isAddress`.
- If the address is invalid, the function returns `notFound()`.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
c1230e6 to
09b7404
Compare
fa3d5ba to
eaeb532
Compare

Problem solved
Short description of the bug fixed or feature added
PR-Codex overview
This PR enhances the
Layoutcomponent by adding a validation check for thecontractAddressparameter to ensure it is a valid address. If the address is invalid, it returns a not found response.Detailed summary
isAddressimport fromthirdweb/utils.isAddressto validateprops.params.contractAddress.notFound()if the address is invalid.